Ext.namespace('system');
system.tryPerformance = function(config) {
	Ext.applyIf(this, config);
	this.initUIComponents();
	system.tryPerformance.superclass.constructor.call(this);
};
Ext.extend(system.tryPerformance, Ext.Panel, {
	initUIComponents : function() {
		// BEGIN OF CODE GENERATION PARTS, DON'T DELETE CODE BELOW
		this.store1 = new Ext.data.Store({
			reader : new Ext.data.JsonReader({
				total : "total",
				id : "id",
				root : "root"
			}, [{
				name : "name",
				mapping : "name"
			}, {
				name : "age",
				mapping : "age",
				type : "int"
			}]),
			proxy : new Ext.data.HttpProxy({})
		});

		this.udpGridPanel = new Ext.grid.GridPanel({
			id : "udpGridPanel",
			store : this.store1,
			columns : [{
				hidden : false,
				sortable : true,
				dataIndex : "Ia",
				header : "攻击请求平均停留间隔(s)"
			}, {
				hidden : false,
				sortable : true,
				dataIndex : "udpT",
				header : "平均停留时间(s)"
			}],
			autoWidth : true,
			selModel : new Ext.grid.RowSelectionModel({}),
			autoHeight : true
		});

		Ext.apply(this, {
			title : "ccc",
			height : 1000,
			items : [{
				region : "center",
				items : [{
					id : "udpForm",
					title : "带宽资源耗尽型攻击",
					frame : "true",
					items : [{
						id : "udpTextLp",
						xtype : "textfield",
						value : "1000",
						fieldLabel : "数据包长度(Bytes)"
					}, {
						id : "udpTextBw",
						xtype : "textfield",
						value : "4",
						fieldLabel : "瓶颈带宽(Mbps)"
					}, {
						id : "udpTextIr",
						xtype : "textfield",
						value : "0.5",
						fieldLabel : "正常请求平均间隔(s)"
					}, {
						id : "udpTextIa",
						xtype : "textfield",
						value : "0.01",
						fieldLabel : "攻击请求平均间隔(s)"
					}, {
						id : "udpTextLt",
						xtype : "textfield",
						value : "5",
						fieldLabel : "一次会话传输的数据总量(MBytes)"
					}, {
						id : "udpButtonCalc",
						text : "计算",
						xtype : "button"
					}, {
						id : "udpTextT",
						xtype : "textfield",
						fieldLabel : "平均停留时间"
					}, {
						id : "udpTextE",
						xtype : "textfield",
						fieldLabel : "UDP Flood攻击绩效"
					}, this.udpGridPanel],
					layout : "form",
					xtype : "form"
				}, {
					title : "主机资源耗尽型攻击",
					frame : "true",
					items : [{
						id : "synTextM",
						xtype : "textfield",
						value : "15",
						fieldLabel : "半开队列长度"
					}, {
						id : "synTextSa",
						xtype : "textfield",
						value : "10",
						fieldLabel : "半开连接超时(s)"
					}, {
						id : "synTextDelay",
						xtype : "textfield",
						value : "0.05",
						fieldLabel : "客户端到服务器的传输时延(s)"
					}, {
						id : "synTextIr",
						xtype : "textfield",
						value : "0.5",
						fieldLabel : "正常请求平均间隔(s)"
					}, {
						id : "synTextIa",
						xtype : "textfield",
						value : "0.01",
						fieldLabel : "攻击请求平均间隔(s)"
					}, {
						id : "synButtonCalc",
						text : "计算",
						xtype : "button"
					}, {
						id : "synTextPb",
						xtype : "textfield",
						fieldLabel : "拒绝服务概率"
					}, {
						id : "synTextE",
						xtype : "textfield",
						fieldLabel : "SYN Flood攻击绩效"
					}, {
						id : "synTextTi",
						xtype : "textfield",
						fieldLabel : "重试间隔(s)"
					}],
					layout : "form",
					xtype : "form"
				}, {
					frame : "true",
					items : [{
						xtype : "textfield"
					}, {
						xtype : "textfield"
					}, {
						xtype : "textfield"
					}, {
						xtype : "textfield"
					}, {
						xtype : "textfield"
					}, {
						xtype : "textfield"
					}, {
						xtype : "textfield"
					}, {
						items : [{
							xtype : "textfield"
						}],
						xtype : "fieldset",
						layout : "form"
					}],
					xtype : "form",
					layout : "form"
				}],
				width : 600,
				xtype : "tabpanel",
				autoWidth : true,
				activeTab : 0
			}, {
				id : "panelChart",
				region : "east",
				title : "图",
				width : 600
			}],
			width : 1000,
			layout : "border"
		});
		// END OF CODE GENERATION PARTS, DON'T DELETE CODE ABOVE

		//		this.resultStore = new Ext.data.Store();
		//		this.udpGridPanel.store = this.resultStore;
		//		var resultRecord = new Ext.data.Record.create([{
		//					name : 'Ia'
		//				}, {
		//					name : 'udpT'
		//				}, {
		//					name : 'synPb'
		//				}]);
		//		var result = new resultRecord({
		//					Ia : 300,
		//					udpT : 3,
		//					synPb : 0.4
		//				});
		//		this.udpGridPanel.store.add(result);
		//		this.add(new Ext.Panel({title:"sadf"}));

	}
});
